﻿Public Class MainMenu

    Inherits System.Web.UI.Page
    Dim objDB As New DBConnect
    Dim userID As New user
    Dim sql As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        objDB = Session("db")
        userID = Session("user")
        Dim ds As New DataSet

    End Sub

    Protected Sub btnPlay_Click(sender As Object, e As EventArgs) Handles btnPlay.Click

        Response.Redirect("./Team Ghana/lobby.aspx")

    End Sub

    Protected Sub btnDeveloper_Click(sender As Object, e As EventArgs) Handles btnDeveloper.Click

        Response.Redirect("PlaceHolder.aspx")

    End Sub

    Protected Sub btnPswd_Click(sender As Object, e As EventArgs) Handles btnPswd.Click

        lblPswd.Visible = True
        txtNewPswd.Visible = True
        txtConfirmPswd.Visible = True
        lblConfirmPswd.Visible = True
        btnSubmit.Visible = True

    End Sub

    Protected Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
        If (txtNewPswd.Text <> txtConfirmPswd.Text) Then
            lblIncorrect.Visible = True
            lblIncorrect.Text = "Your passwords do not match. Please try again."
        End If

        If (txtConfirmPswd.Text = "" Or txtNewPswd.Text = "") Then
            lblIncorrect.Visible = True
            lblIncorrect.Text = "You cannot have blanks."
        ElseIf (txtNewPswd.Text = txtConfirmPswd.Text) Then
            userID.password = txtConfirmPswd.Text
            sql = "Update Participant set Password = '" & txtConfirmPswd.Text & "' Where (ParticipantID = '" & userID.participantID & "')"
            objDB.doUpdate(sql)
            lblIncorrect.Visible = True
            lblIncorrect.Text = "Password has been updated"
            txtNewPswd.Enabled = False
            txtConfirmPswd.Enabled = False
        End If

    End Sub

    Protected Sub btnGamePerm_Click(sender As Object, e As EventArgs) Handles btnGamePerm.Click

        Response.Redirect("GameDevelopmentManagement.aspx")

    End Sub
End Class